/*
 * File:   Map.cpp
 * Author: Elevator
 *
 * Created on August 4, 2013, 8:26 PM
 */

#include "Map.h"

Map::Map( )
{
}

Map::Map( ICollection<Obstacle*>* obstacles )
{
	for( IteratorPtr<Obstacle*> obstaclesIter( obstacles->GetIterator( ) );
			!obstaclesIter->IsEnd( );
			obstaclesIter->Next( ) )
	{
		_obstacles.Add( obstaclesIter->Current( ) );
	}
}

Map::~Map( )
{
}

void Map::Update( float dt )
{
	for( IteratorPtr<Obstacle*> obstacles( _obstacles.GetIterator() );
			!obstacles->IsEnd( );
			obstacles->Next( ) )
	{
		obstacles->Current( )->Update( dt );
	}
}

void Map::Draw( ) const
{
	for( IteratorPtr<Obstacle*> obstacles( _obstacles.GetIterator() );
			!obstacles->IsEnd( );
			obstacles->Next( ) )
	{
		obstacles->Current( )->Draw( );
	}
}
